<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Bootstrap CSS-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/vendor/bootstrap/css/bootstrap.css">
    <!-- Font Awesome CSS-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/vendor/font-awesome/css/font-awesome.min.css">
    <!-- Custom Font Icons CSS-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/font.css">
    <!-- theme stylesheet-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/style.default.css" id="theme-stylesheet">
    <!-- Custom stylesheet - for your changes-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/custom.css">
    <title>部门</title>

</head>
<body>
<%@include file="../publicjsp/head.jsp"%>
<div class="d-flex align-items-stretch">
    <%@include file="../publicjsp/sidebar.jsp"%>
    <!-- Sidebar Navigation end-->
    <c:if test="${secretMsg!=null}">
        <script>
            location.reload();
            alert("${secretMsg}");
            <%request.getSession().removeAttribute("secretMsg");%>
        </script>
    </c:if>
    <div class="page-content">
        <div class="page-header">
            <div class="container-fluid">
                <h2 class="h5 no-margin-bottom">全部部门</h2>
            </div>
        </div>
        <section class="no-padding-bottom">

            <div class="list-group myList">
                <ul>
                    <c:forEach var="dl" items="${deptList}">
                        <li class="list-group-item">
                            <a href="#">${dl.name}</a>
                            <span>&nbsp;</span>
                            <span>${dl.totalUser}</span>人
                            <div class="list-group myGroup isHidden">
                                <ul>
                                    <c:if test="${dl.totalUser==0}">
                                        <li class="list-group-item">
                                            <a href="javascript:;">该部门还没有人任职</a>
                                        </li>
                                    </c:if>
                                    <c:if test="${dl.totalUser!=0}">
                                        <c:forEach var="du" items="${deptUser}">
                                            <c:if test="${dl.name==du.name}">
                                                <li class="list-group-item">
                                                    <a href="${pageContext.request.contextPath}/dept/deptLookUser?userId=${du.uid}">${du.real_name}</a>
                                                </li>
                                            </c:if>
                                        </c:forEach>
                                    </c:if>
                                </ul>
                            </div>
                        </li>
                    </c:forEach>

                </ul>
            </div>
        </section>

        <%@include file="../publicjsp/footer.jsp"%>
    </div>
</div>

<!-- JavaScript files-->
<script src="${pageContext.request.contextPath}/assets/vendor/jquery/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/vendor/popper.js/umd/popper.min.js"> </script>
<script src="${pageContext.request.contextPath}/assets/vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/vendor/jquery.cookie/jquery.cookie.js"> </script>
<script src="${pageContext.request.contextPath}/assets/vendor/chart.js/Chart.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/vendor/jquery-validation/jquery.validate.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/charts-home.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/front.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/custom.js"></script>
</body>
</html>